<?php

namespace app\admin\model\validate;

use think\Validate;

class AlbumImg extends Validate {
    protected $rule =   [
        'album_id'  => 'require',
        //'open_id' => 'require',
        'img_url' => 'require|max:500',
        'desc' => 'max:500',
        //'content' => 'require',
        'sort' => 'number',
    ];

    protected $message  =   [
        'album_id.require' => '相册不能为空',
        'img_url.require' => '图片地址不能为空',
        'img_url.max' => '图片地址不能超过500个字符',
        'desc.max' => '描述不能超过500个字符',
        'sort.number'     => '排序必须是数字',
        //'open_id.require'     => 'OPEN ID 不能为空',
    ];

    protected $scene = [
        /*'add'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],
        'edit'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],*/
    ];
}